<%@ page import="com.ikun.pojo.TbUser" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
    TbUser tbUserNow = (TbUser) session.getAttribute("tbUserNow");
%>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <!-- 自适应手机屏幕 -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes"/>

    <title>生机校园帮|个人信息</title>

    <script src="${ctx}/js/jquery-1.11.0.min.js"></script>
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all">
    <script src="${ctx}/layui/layui.js" charset="utf-8"></script>

    <link rel="stylesheet" href="${ctx}/page/css/myinfo.css">
    <script>
        var ctx = "${ctx}";
    </script>
    <script>
        var user_id = "<%=tbUserNow.getId() %>";
        var nickname = "<%=tbUserNow.getNickname() %>";
        var user_pic = "<%=tbUserNow.getPic() %>";
        var realname = "<%=tbUserNow.getRealname() %>";
        var account = "<%=tbUserNow.getAccount() %>";
        var sex = "<%=tbUserNow.getSex() %>";
        var email = "<%=tbUserNow.getEmail() %>";
        var phone = "<%=tbUserNow.getPhone() %>";
        var department = "<%=tbUserNow.getDepartment() %>";
        var profession = "<%=tbUserNow.getProfession() %>";
        var classes = "<%=tbUserNow.getClasses() %>";
        var balance = "<%=tbUserNow.getBalance() %>";
    </script>
    <script src="${ctx}/page/js/myinfo.js" charset="utf-8"></script>
</head>
<body>

<div id="top">
    <div class="top-nav-now" onclick="topNavClick(this)">我的资料</div>
    <div class="top-nav" onclick="topNavClick(this)">头像</div>
    <div class="top-nav" onclick="topNavClick(this)">密码</div>
    <div class="top-nav" onclick="topNavClick(this)">账号绑定</div>
</div>

<!-- 我的资料 -->
<div id="middle-mydata">
    <div id="phone">
        <span class="mydata-text">手机</span>
        <input type="text" name="text-phone" id="text-phone" readonly="readonly" value="<%=tbUserNow.getPhone() %>"/>
        <span class="data-msg">您已完成手机号绑定，已正式成为社区实名用户。</span>
        <span class="data-msg2">手机号暂不支持修改。</span>
    </div>
    <div id="email">
        <span class="mydata-text">邮箱</span>
        <input type="text" name="text-email" id="text-email" readonly="readonly" value="<%=tbUserNow.getEmail() %>"/>
        <span class="data-msg">您的邮箱已激活，可通过邮箱找回密码。</span>
        <span class="data-msg2">邮箱暂不支持修改。</span>
    </div>
    <div id="nickname">
        <span class="mydata-text">昵称</span>
        <input type="text" name="text-nickname" id="text-nickname" value="<%=tbUserNow.getNickname() %>"/>
        <div id="sex">
            <input type="radio" id="male" name="text-sex" value="男"/>
            <label for="male" id="laMale">男</label>
            &nbsp;&nbsp;&nbsp;
            <input type="radio" id="female" name="text-sex" value="女"/>
            <label for="female" id="laFemale">女</label>
        </div>
    </div>
    <fieldset>
        <legend>管理员凭以下信息发放奖品（以下信息是隐私信息，本开发组承诺不会主动泄露）</legend>
        <div id="department">
            <span class="mydata-text">院系</span>
            <select name="text-department" id="text-department">
                <option value="">请选择</option>
                <option value="信息系">信息系</option>
            </select>
        </div>
        <div id="profession">
            <span class="mydata-text">专业</span>
            <select name="text-profession" id="text-profession">
                <option value="">请选择</option>
                <option value="移动应用开发（校企班）">移动应用开发（校企班）</option>
            </select>
        </div>
        <div id="classes">
            <span class="mydata-text">班级</span>
            <select name="text-classes" id="text-classes">
                <option value="">请选择</option>
                <option value="17309">17309</option>
                <option value="17310">17310</option>
                <option value="17311">17311</option>
                <option value="17312">17312</option>
                <option value="17313">17313</option>
                <option value="17314">17314</option>
                <option value="17315">17315</option>
                <option value="17316">17316</option>
                <option value="17317">17317</option>
                <option value="17318">17318</option>
                <option value="17319">17319</option>
                <option value="17320">17320</option>
                <option value="17321">17321</option>
                <option value="17322">17322</option>
            </select>
        </div>
        <div id="realname">
            <span class="mydata-text">真实姓名</span>
            <input type="text" name="text-realname" id="text-realname" value="<%=tbUserNow.getRealname() %>"/>
        </div>

    </fieldset>
    <div id="btn-update-data" onclick="updateMyInfo()">确认修改</div>
</div>

<!-- 头像 -->
<div id="middle-mypic">

    <div class="layui-upload">
        <button type="button" id="test1">上传图片</button>
        <div class="layui-upload-list">
            <%--<img class="layui-upload-img" id="demo1">--%>
            <div id="show-img">
                <div id="hide-color"></div>
                <div id="radio-img"></div>
            </div>
            <p id="demoText"></p>
        </div>
    </div>

</div>

<div id="middle-mypwd">
    <div id="old-pwd">
        <span class="pwd-text">旧密码</span>
        <input type="password" name="text-old-pwd" id="text-old-pwd" oninput="hideMsg(this)"/>
        <span class="data-msg3">旧密码不能为空</span>
    </div>
    <div id="new-pwd">
        <span class="pwd-text">新密码</span>
        <input type="password" name="text-new-pwd" id="text-new-pwd" oninput="hideMsg(this)"/>
        <span class="data-msg3"></span>
    </div>
    <div id="confirm-pwd">
        <span class="pwd-text">确认密码</span>
        <input type="password" name="text-confirm-pwd" id="text-confirm-pwd" oninput="hideMsg(this)"/>
        <span class="data-msg3"></span>
    </div>
    <div id="btn-update-pwd" onclick="updateMyPwd()">确认修改</div>
</div>

<div id="middle-myaccount">
    <div id="account-msg">暂未开通此功能</div>
</div>

</body>
</html>
